<template>
<div>
  <el-table
      v-loading="loading"
      element-loading-text="拼命加载中"
      :data="tableData">
    <el-table-column
        prop="logID"
        sortable
        label="日志编号"

    >
    </el-table-column>
    <el-table-column
        sortable
        prop="date"
        label="日期"
    >
    </el-table-column>
    <el-table-column
        prop="way"
        label="方式"
    >
    </el-table-column>
    <el-table-column
        prop="type"
        label="类型"
    >
    </el-table-column>
    <el-table-column
        prop="reason"
        label="原因"
    >
    </el-table-column>
    <el-table-column
        prop="peopleID"
        label="人员ID"
    >
    </el-table-column>
  </el-table>
</div>
</template>

<script>
import {DateTurn, HttpManager} from "@/api";

export default {
  name: "Tab2",
  data(){
    return {
      tableData:[],
      loading:true
    }
  },
  mounted() {
    HttpManager.getAllLogDate().then(
        (response) => {
          for (let i = 0;i < response.length;i++) {
            //格式化日期的格式,不然会显示13位的数字
            response[i].date = DateTurn.timeToString(response[i].date)
          }
          this.tableData = response
        }
    )
  },
  updated() {
    this.loading = false
  }
}
</script>

<style scoped>

</style>
